package collection;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo1 {
    public static void main(String[] args) {
      //Collection c = new HashSet();
        Collection  c =new ArrayList();
        c.add("1");
        c.add("2");
        c.add("3");
        c.add("4");
        c.add("5");

        boolean a = c.add("6");
        System.out.println(c);
        System.out.println(a);

        System.out.println(c.size());
        System.out.println(c.isEmpty());
        c.clear();
        System.out.println("集合已清空");
        System.out.println(c);
        System.out.println(c.size());
        System.out.println(c.isEmpty());
    }
}
